package com.efrei.uchat.client.gui.view;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JButton;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;

public class CroomTab extends JPanel {

	private static final long serialVersionUID = 4311318624792600607L;
	
	private JTextField textMessage;
	
	private JList listMessages;
	private JList listUsers;
	
	private JButton btnSubmit;
	private JButton btnLeave;
	private JScrollPane scrollPane;
	private JScrollPane scrollPane_1;
	
	public CroomTab(String croom) {
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{0, 0, 0};
		gridBagLayout.rowHeights = new int[]{0, 254, 0, 0};
		gridBagLayout.columnWeights = new double[]{4.0, 1.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{1.0, 6.0, 2.0, Double.MIN_VALUE};
		setLayout(gridBagLayout);
		
		this.btnLeave = new JButton("Leave");
		GridBagConstraints gbc_btnLeave = new GridBagConstraints();
		gbc_btnLeave.insets = new Insets(0, 0, 5, 0);
		gbc_btnLeave.gridx = 1;
		gbc_btnLeave.gridy = 0;
		add(this.btnLeave, gbc_btnLeave);
		
		this.scrollPane = new JScrollPane();
		GridBagConstraints gbc_scrollPane = new GridBagConstraints();
		gbc_scrollPane.fill = GridBagConstraints.BOTH;
		gbc_scrollPane.insets = new Insets(0, 0, 5, 5);
		gbc_scrollPane.gridx = 0;
		gbc_scrollPane.gridy = 1;
		add(this.scrollPane, gbc_scrollPane);
		
		this.listMessages = new JList();
		this.scrollPane.setViewportView(this.listMessages);
		
		this.scrollPane_1 = new JScrollPane();
		GridBagConstraints gbc_scrollPane_1 = new GridBagConstraints();
		gbc_scrollPane_1.fill = GridBagConstraints.BOTH;
		gbc_scrollPane_1.insets = new Insets(0, 0, 5, 0);
		gbc_scrollPane_1.gridx = 1;
		gbc_scrollPane_1.gridy = 1;
		add(this.scrollPane_1, gbc_scrollPane_1);
		
		this.listUsers = new JList();
		this.scrollPane_1.setViewportView(this.listUsers);
		
		this.textMessage = new JTextField();
		GridBagConstraints gbc_textField = new GridBagConstraints();
		gbc_textField.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField.insets = new Insets(0, 0, 0, 5);
		gbc_textField.gridx = 0;
		gbc_textField.gridy = 2;
		add(this.textMessage, gbc_textField);
		this.textMessage.setColumns(10);
		
		this.btnSubmit = new JButton("Envoyer");
		GridBagConstraints gbc_btnSubmit = new GridBagConstraints();
		gbc_btnSubmit.gridx = 1;
		gbc_btnSubmit.gridy = 2;
		add(this.btnSubmit, gbc_btnSubmit);
	}
	
	public JButton getBtnLeave() {
		return btnLeave;
	}
	
	public JButton getBtnSubmit() {
		return btnSubmit;
	}
	
	public JTextField getTextMessage() {
		return textMessage;
	}
	
	public JList getListMessages() {
		return listMessages;
	}
	
	public JList getListUsers() {
		return listUsers;
	}
}
